<% layout('layout') -%>
<div class="auth-wrapper">
  <div class="auth-card">
    <h2>注册新账号</h2>
    <p class="muted">选择身份并完善信息，立即参与在线招投标</p>
    <form method="post" action="/auth/register" class="form">
      <label>
        用户名
        <input name="username" placeholder="请输入用户名" required>
      </label>
      <label>
        密码
        <input type="password" name="password" placeholder="设置密码" required>
      </label>
      <label>
        角色身份
        <select name="role" required>
          <option value="BIDDER">投标单位</option>
          <option value="TENDERER">招标单位</option>
        </select>
      </label>
      <label>
        单位名称
        <input name="company_name" placeholder="如：XX 药业集团">
      </label>
      <label>
        法人姓名
        <input name="legal_person" placeholder="法人代表姓名">
      </label>
      <label>
        联系电话
        <input name="phone" placeholder="联系方式">
      </label>
      <div class="form-actions">
        <button type="submit">注册</button>
        <a class="btn-outline" href="/auth/login">返回登录</a>
      </div>
      <% if (error) { %>
        <div class="error"><%= error %></div>
      <% } %>
    </form>
  </div>
</div>


